// 版权归 Epic Games, Inc. 所有，保留所有权利。

#pragma once

#include "Messaging/CommonMessagingSubsystem.h"
#include "Templates/SubclassOf.h"
#include "UObject/SoftObjectPtr.h"

#include "LyraUIMessaging.generated.h"

class FSubsystemCollectionBase;
class UCommonGameDialog;
class UCommonGameDialogDescriptor;
class UObject;

/**
 * Lyra UI 消息子系统
 */
UCLASS()
class ULyraUIMessaging : public UCommonMessagingSubsystem
{
	GENERATED_BODY()

public:
	ULyraUIMessaging() { } // 构造函数

	/**
	 * 初始化子系统
	 * @param Collection 子系统集合基类引用
	 */
	virtual void Initialize(FSubsystemCollectionBase& Collection) override;

	/**
	 * 显示确认对话框
	 * @param DialogDescriptor 对话框描述符
	 * @param ResultCallback 结果回调委托
	 */
	virtual void ShowConfirmation(UCommonGameDialogDescriptor* DialogDescriptor, FCommonMessagingResultDelegate ResultCallback = FCommonMessagingResultDelegate()) override;

	/**
	 * 显示错误对话框
	 * @param DialogDescriptor 对话框描述符
	 * @param ResultCallback 结果回调委托
	 */
	virtual void ShowError(UCommonGameDialogDescriptor* DialogDescriptor, FCommonMessagingResultDelegate ResultCallback = FCommonMessagingResultDelegate()) override;

private:
	UPROPERTY()
	TSubclassOf<UCommonGameDialog> ConfirmationDialogClassPtr; // 确认对话框类指针

	UPROPERTY()
	TSubclassOf<UCommonGameDialog> ErrorDialogClassPtr; // 错误对话框类指针

	UPROPERTY(config)
	TSoftClassPtr<UCommonGameDialog> ConfirmationDialogClass; // 配置：确认对话框软类指针

	UPROPERTY(config)
	TSoftClassPtr<UCommonGameDialog> ErrorDialogClass; // 配置：错误对话框软类指针
};